package com.cn.wanxi.publisher;

import com.cn.wanxi.publisher.thread.SelfThread;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class PublisherApplication {


    public static void main(String[] args) {
        ConfigurableApplicationContext app = SpringApplication.run(PublisherApplication.class, args);

        RabbitTemplate rabbitTemplate = app.getBean(RabbitTemplate.class);

        Thread tmp;
        for (int i = 0; i < 5; i++) {
            tmp = new SelfThread("自定义线程" + i, rabbitTemplate);
            tmp.start();
        }

    }

}
